﻿@using HCMS.Extensions
@using HCMS.Utils
@using System.Net
@model HCMS.Entities.OAuth2.ApiRequestLogs
@{
    Layout = "~/Views/Shared/_Layout_Edit_Pear_Layui.cshtml";
}

<div class="layui-body layui-bg-gray">
    <div class="layui-card">
        <div class="layui-tab layui-tab-card">
            <ul class="layui-tab-title">
                <li class="layui-this">基础信息</li>
                <li>请求参数</li>
                <li>返回结果</li>
                <li>客户端信息</li>
            </ul>

            <div class="layui-tab-content">
                <!-- 基础信息 -->
                <div class="layui-tab-item layui-show">
                    <div class="layui-form-item">
                        <div class="layui-form-label">访问链接</div>
                        <div class="layui-form-label content-label" style="max-width:85%;overflow-wrap: break-word;">
                            @WebUtility.UrlDecode(Model.Url ?? "")
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-form-label">控制器</div>
                        <div class="layui-form-label content-label">
                            @Model.ControllerName
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-form-label">方法</div>
                        <div class="layui-form-label content-label">
                            @Model.ActionName
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-form-label">请求方式</div>
                        <div class="layui-form-label content-label">
                            @Model.HttpMethod
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-form-label">开始 时间</div>
                        <div class="layui-form-label content-label">
                            @Model.StartTime
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-form-label">结束 时间</div>
                        <div class="layui-form-label content-label">
                            @Model.EndTime
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-form-label">消耗 时间</div>
                        <div class="layui-form-label content-label">
                            @DateTimeUtil.ExecutionTimeStr(Model.ExecutionTime)
                        </div>
                    </div>
                </div>

                <!-- 请求参数 -->
                <div class="layui-tab-item">
                    <div class="layui-form-item">
                        <div class="layui-form-label">@(Model.HttpMethod) 参数</div>
                        <div class="layui-form-label content-label" style="max-width:85%;overflow-wrap: break-word;">
                            @WebUtility.UrlDecode(Model.Parameter ?? "")
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-form-label">请求头</div>
                        <div class="layui-form-label content-label" style="max-width:85%;overflow-wrap:break-word;">
                            @Html.Raw(Model.HeaderInfo)
                        </div>
                    </div>
                </div>

                <!-- 返回结果 -->
                <div class="layui-tab-item">
                    <div class="layui-form-item">
                        <div class="layui-form-label">返回内容</div>
                        <div class="layui-form-label content-label">
                            @Html.Raw(Model.ResultInfo)
                        </div>
                    </div>
                </div>

                <!-- 客户端信息 -->
                <div class="layui-tab-item">
                    <div class="layui-form-item">
                        <div class="layui-form-label">Ip</div>
                        <div class="layui-form-label content-label">
                            @Model.Ip
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-form-label">来源链接</div>
                        <div class="layui-form-label content-label">
                            @WebUtility.UrlDecode(Model.RefererUrl ?? "")
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-form-item layui-fixbar btn-fixbar-box">
            <div class="layui-input-block">
                <button type="button" class="layui-btn layui-btn-primary layui-border-red" lay-on="close">
                    <i class="layui-icon layui-icon-close"></i>关闭
                </button>
            </div>
        </div>
    </div>
</div>